//对外暴漏噢配置路由(常量路由)
import Layout from '@/layout/index.vue'
export const constantRoutes = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/login/index.vue'),
    meta: {
      title: '登录', //菜单标题
      hidden: true, //是否显示在侧边栏 true就是不显示 false就显示
      icon: 'WarnTriangleFilled' //图标,支持element-plus图标库
    }
  },
  {
    path: '/',
    name: 'Layout',
    component: Layout,
    redirect: '/home', //重定向到home页面
    children: [
      //二级子路由组件
      {
        path: 'home', //二级路由不需要加/
        name: 'Home',
        component: () => import('@/views/home/index.vue'),
        meta: {
          title: '首页', //菜单标题
          hidden: false, //是否显示在侧边栏 true就是不显示 false就显示
          icon: 'HomeFilled'
        }
      }
    ]
  },

  {
    path: '/system',
    component: Layout, // 一级路由组件
    redirect: '/system/user',
    meta: { title: '系统管理', icon: 'Tools', hidden: false },
    name: 'System',
    children: [
      {
        path: 'user', // ,不为空时是 一级path+二级path,二级不用加 /
        name: 'User',
        component: () => import('@/views/system/user/index.vue'),
        meta: {
          title: '用户管理',
          icon: 'UserFilled',
          hidden: false
        }
      },
      {
        path: 'role', // 不为空时是 一级path+二级path,二级不用加 /
        name: 'Role',
        component: () => import('@/views/system/role/index.vue'),
        meta: {
          title: '角色管理',
          icon: 'Avatar',
          hidden: false
        }
      },
      {
        path: 'menu', // 不为空时是 一级path+二级path,二级不用加 /
        name: 'Menu',
        component: () => import('@/views/system/menu/index.vue'),
        meta: {
          title: '菜单管理',
          icon: 'Menu',
          hidden: false
        }
      }
    ]
  },
  {
    path: '/product',
    component: Layout, // 一级路由组件
    name: 'Product',
    redirect: '/product/trademark',
    meta: { title: '商品管理', icon: 'Goods', hidden: false },
    children: [
      {
        path: 'trademark', // ,不为空时是 一级path+二级path,二级不用加 /
        name: 'Trademark',
        component: () => import('@/views/product/trademark/index.vue'),
        meta: {
          title: '品牌管理',
          icon: 'ShoppingCartFull',
          hidden: false
        }
      },
      {
        path: 'attribute', // ,不为空时是 一级path+二级path,二级不用加 /
        name: 'Attribute',
        component: () => import('@/views/product/attribute/index.vue'),
        meta: {
          title: '属性管理',
          icon: 'Briefcase',
          hidden: false
        }
      },
      {
        path: 'spu', // ,不为空时是 一级path+二级path,二级不用加 /
        name: 'Spu',
        component: () => import('@/views/product/spu/index.vue'),
        meta: {
          title: 'SPU管理',
          icon: 'SwitchFilled',
          hidden: false
        }
      },
      {
        path: 'sku', // ,不为空时是 一级path+二级path,二级不用加 /
        name: 'Sku',
        component: () => import('@/views/product/sku/index.vue'),
        meta: {
          title: 'SKU管理',
          icon: 'WalletFilled',
          hidden: false
        }
      }
    ]
  },
  {
    path: '/screen',
    name: 'Screen',
    component: () => import('@/views/screen/index.vue'),
    meta: {
      title: '数据大屏', //菜单标题
      hidden: false, //是否显示在侧边栏 true就是不显示 false就显示
      icon: 'Platform'
    }
  },
  {
    path: '/404',
    name: 'NotFound',
    component: () => import('@/views/404/index.vue'),
    meta: {
      title: '404', //菜单标题
      hidden: true, //是否显示在侧边栏 true就是不显示 false就显示
      icon: 'Comment'
    }
  },
  // 如果都不匹配，转发到404路由
  {
    path: '/:pathMatch(.*)*',
    redirect: '/404',
    name: 'Any',
    meta: {
      title: '任意路由', //菜单标题
      hidden: true, //是否显示在侧边栏 true就是不显示 false就显示
      icon: 'Histogram'
    }
  }
]
